package com.luyuan.gallery.service.impl;

import java.util.List;
import com.luyuan.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.luyuan.gallery.mapper.ExhiArtistMapper;
import com.luyuan.gallery.domain.ExhiArtist;
import com.luyuan.gallery.service.IExhiArtistService;

/**
 * 艺术家Service业务层处理
 * 
 * @author luyuan
 * @date 2025-11-13
 */
@Service
public class ExhiArtistServiceImpl implements IExhiArtistService {
    @Autowired
    private ExhiArtistMapper exhiArtistMapper;

    /**
     * 查询艺术家
     * 
     * @param artistId 艺术家主键
     * @return 艺术家
     */
    @Override
    public ExhiArtist selectExhiArtistByArtistId(Long artistId) {
        return exhiArtistMapper.selectExhiArtistByArtistId(artistId);
    }

    /**
     * 查询艺术家列表
     * 
     * @param exhiArtist 艺术家
     * @return 艺术家
     */
    @Override
    public List<ExhiArtist> selectExhiArtistList(ExhiArtist exhiArtist) {
        return exhiArtistMapper.selectExhiArtistList(exhiArtist);
    }

    /**
     * 新增艺术家
     * 
     * @param exhiArtist 艺术家
     * @return 结果
     */
    @Override
    public int insertExhiArtist(ExhiArtist exhiArtist) {
        exhiArtist.setCreateTime(DateUtils.getNowDate());
        return exhiArtistMapper.insertExhiArtist(exhiArtist);
    }

    /**
     * 修改艺术家
     * 
     * @param exhiArtist 艺术家
     * @return 结果
     */
    @Override
    public int updateExhiArtist(ExhiArtist exhiArtist) {
        exhiArtist.setUpdateTime(DateUtils.getNowDate());
        return exhiArtistMapper.updateExhiArtist(exhiArtist);
    }

    /**
     * 批量删除艺术家
     * 
     * @param artistIds 需要删除的艺术家主键
     * @return 结果
     */
    @Override
    public int deleteExhiArtistByArtistIds(Long[] artistIds) {
        return exhiArtistMapper.deleteExhiArtistByArtistIds(artistIds);
    }

    /**
     * 删除艺术家信息
     * 
     * @param artistId 艺术家主键
     * @return 结果
     */
    @Override
    public int deleteExhiArtistByArtistId(Long artistId) {
        return exhiArtistMapper.deleteExhiArtistByArtistId(artistId);
    }
}
